<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<html>
<head>
	<title>Welcome</title>
	<script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/mediaplayer/base.js"></script>
</head>
 
<body>
 
    <div id="wrapper" class="wrapperLogin">	
		<div class="container">
		
			<!-- LOGO -->
			<div id="logo" align="center" >
				<h1> share Music </h1>		
			</div>
			
			<!-- PLAYER -->
			<div class="player">
				<div class="playerLeft">.</div>
				<div style="width:10%; float:left;">
					<a href="javascript:musicPrev('l')"><div class="imageIcon prev"></div></a>
					<a href="javascript:musicPlayPause('l')"><div class="imageIcon playPause"></div></a>
					<a href="javascript:musicStop('l')"><div class="imageIcon stop"></div></a>
					<a href="javascript:musicNext('l')"><div class="imageIcon next"></div></a>
				</div>
				<div class="playerRight"></div>
			</div>	
			
			<!-- LIST -->
			<div class="playlistClass">
				<s:if test="%{playlists.size>0}">
					<table class="tablePlaylist">
						<tr>
							<th>id</th>
							<th>nome</th>
							<th>durata</th>
							<th>stato</th>
						</tr>
						<s:iterator value="playlists" status="playlistsStatus">
							<tr>
						    	<td style="background: #CCCCCC"><s:property value="id" /></td>
						      	<td><s:property value="nome" /></td>
						      	<td><s:property value="durata" /></td>
						      	<td>
						      		<s:if test="%{stato}">now playing</s:if>
						      		<s:else>
						      			<a href="javascript:alert('start')"><div class="imageIcon play"></div></a>
						      		</s:else>	
						      	</td>
						  	</tr>
						</s:iterator>
					</table>
					<s:form action="registerPlaylist.action" method="post" enctype="multipart/form-data">
					    <s:submit method="execute" value="Crea Playlist" align="center" cssClass="buttonPlus"/>
					</s:form>
				</s:if>
				<s:else>
				    <a href="<s:url action="registerPlaylist"></s:url>">Crea Playlist </a>
				</s:else>	
			</div>
			<div class="braniClass">
				<s:if test="%{branoList.size>0}">
					<table class="tablePlaylist">
						<tr>
							<th>titolo</th>
						</tr>
						<s:iterator value="branoList" status="branoListStatus">
							<tr>
						    	<td style="background: #CCCCCC"><s:property value="id" /></td>
						      	<td><s:property value="titolo" /></td>
						  	</tr>
						</s:iterator>
					</table>
				</s:if>
			
			</div>
			<div class="utentiCollegatiClass">
				<s:if test="%{guestList.size>0}">
					<table>
						<tr>
							<th>id</th>
							<th>username</th>
						</tr>
						<s:iterator value="guestList" status="guestStatus">
							<tr>
						    	<td style="background: #CCCCCC"><s:property value="id" /></td>
						      	<td><s:property value="username" /></td>
						  	</tr>
						</s:iterator>
					</table>
				</s:if>
				<s:else>
				    Nessun utente collegato!!!
				</s:else>
			</div>
		</div>
	</div>	
</body>
</html>